<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="人才状态" prop="expectStation">
        <el-select v-model="queryParams.status" placeholder="请选择状态" style="width: 150px">
          <el-option label="全部" value="" @keyup="handleQuery"></el-option>
          <el-option label="已投递" value="1" @keyup="handleQuery"></el-option>
          <el-option label="未投递" value="0" @keyup="handleQuery"></el-option>
          <el-option label="待录用" value="2" @keyup="handleQuery"></el-option>
          <el-option label="待入职" value="3" @keyup="handleQuery"></el-option>
          <el-option label="已入职" value="6" @keyup="handleQuery"></el-option>
          <el-option label="已离职" value="4" @keyup="handleQuery"></el-option>
          <el-option label="放弃入职" value="11" @keyup="handleQuery"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item style="margin-top: 5px" prop="beginTime">
        <el-date-picker clearable
                        v-model="queryParams.beginTime"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="开始日期" style="width: 150px">
        </el-date-picker>
      </el-form-item>
      &nbsp;&nbsp;&nbsp;
      <el-form-item style="margin-top: 5px" prop="endTimee">
        <el-date-picker clearable
                        v-model="queryParams.endTimee"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="结束日期" style="width: 150px">
        </el-date-picker>
      </el-form-item>

      <el-form-item  prop="expectStation">
        <el-select v-model="queryParams.workyear" placeholder="请选择等级" style="width: 150px">
          <el-option label="全部" value="" @keyup="handleQuery"></el-option>
          <el-option label="初级" value="1" @keyup="handleQuery"></el-option>
          <el-option label="中级" value="4" @keyup="handleQuery"></el-option>
          <el-option label="高级" value="6" @keyup="handleQuery"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item style="margin-top: 5px" prop="companyName">
        <el-input
          v-model="queryParams.all"
          placeholder="请输入搜索内容"
          clearable
          @keyup.enter.native="handleQuery"
          style="width: 150px"
        />
      </el-form-item>
      &nbsp;&nbsp;&nbsp;

      <el-form-item style="margin-top: 5px">
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
      <br>

    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:resume:add']"
        >新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:resume:edit']"
        >修改
        </el-button>
      </el-col>

      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-s-promotion"
          size="mini"
          :disabled="multiple"
          @click="playVideoA"
          v-hasPermi="['system:resume:stationLst']"
        >批量推送
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:resume:export']"
        >导出
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <!--简历列表展示-->
    <el-table v-loading="loading" :data="resumeList" @selection-change="handleSelectionChange">
      <el-table-column fixed type="selection" width="30" align="center"/>
      <!--      <el-table-column label="简历id" align="center" prop="resumeId" />-->
      <el-table-column width="100" label="简历姓名" align="center" prop="resumeName"/>
      <el-table-column width="160" :show-overflow-tooltip="true" label="适合岗位" align="center" prop="expectStation"/>
      <el-table-column width="50" label="年龄" prop="age" align="center"/>
      <el-table-column width="120" label="工作经验（年）" align="center" prop="workyear">
        <template slot-scope="scope">
          {{ scope.row.workyear }}
        </template>
      </el-table-column>
      <el-table-column width="120" label="电话" align="center" prop="phone"/>
      <el-table-column width="80" prop="currentState" label="在职状态" align="center"/>
      <el-table-column width="110" :show-overflow-tooltip="true" prop="college" label="毕业院校" align="center"/>
      <el-table-column width="110"  :show-overflow-tooltip="true" prop="major" label="专业" align="center"/>
      <el-table-column width="80" label="期望薪资" prop="expectWage" align="center"/>
      <el-table-column width="100" label="期望工作地点" prop="workplace" align="center"/>
      <el-table-column width="200" :show-overflow-tooltip="true" prop="opinion" label="初审意见" align="center"/>
      <el-table-column width="80" label="状态" align="center" prop="status">
        <template slot-scope="scope">
          <span v-if="scope.row.status == 0">
            <el-tag type="info">未投递</el-tag>
          </span>
          <span v-if="scope.row.status == 1">
             <el-tag type="primary">已投递</el-tag>
          </span>
          <span v-if="scope.row.status == 2">
             <el-tag type="warning">待录用</el-tag>
          </span>
          <span v-if="scope.row.status == 3">
             <el-tag type="success">待入职</el-tag>
          </span>
          <span v-if="scope.row.status == 6">
             <el-tag type="success">已入职</el-tag>
          </span>
          <span v-if="scope.row.status == 4">
             <el-tag type="danger">已离职</el-tag>
          </span>
          <span v-if="scope.row.status == 11">
             <el-tag type="warning">放弃入职</el-tag>
          </span>
        </template>
      </el-table-column>
      <el-table-column width="130" label="创建时间" align="center" prop="createTime">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column width="100" label="创建人" align="center" prop="createName"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="250">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-s-management"
            @click="getResume(scope.row.resumeId)"
            v-hasPermi="['system:resume:query']"
          >查看简历
          </el-button>
          <el-button
            :disabled="scope.row.status === '3' || scope.row.status === '6'"
            size="mini"
            v-if="scope.row.status !== '11'"
            type="text"
            icon="el-icon-s-promotion"
            @click="playVideo(scope.row.resumeId,scope.row.imgPath)"
          >投递岗位
          </el-button>
          <el-button
            :disabled="scope.row.status != '0'"
            size="mini"
            type="text"
            icon="el-icon-s-promotion"
            v-if="scope.row.status !== '11'"
            @click="handleDelete(scope.row)"
          >删除简历
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList()"
    />

    <!-- 添加或修改【请填写功能名称】对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="90%" :close-on-click-modal='false' append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-row :gutter="24">
          <el-col :span="12" style="float: left;padding-left: 20px;padding-bottom: 10px">
            <el-form-item label="" prop="filePath">
              <el-upload
                ref="uploadRef"
                action=""
                accept=".pdf"
                :auto-upload="false"
                :on-change="handleChange"
                :show-file-list="false">
                <el-button
                  type="warning"
                  size="mini"
                >上传简历附件
                </el-button>
                <span v-text="this.filePath"></span>
                <span v-model="form.filePath"></span>
              </el-upload>
            </el-form-item>

          </el-col>

        </el-row>

        <el-row>
          <el-col :span="4.5">
            <el-form-item label="姓名" prop="resumeName">
              <el-input v-model="form.resumeName" placeholder="请输入姓名" label-width="40px" style="width: 150px"/>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </el-form-item>
          </el-col>


          <el-col :span="4.5">
            <el-form-item label="性别" prop="sex">
              <el-select v-model="form.sex" name="本科" placeholder="请选择性别" style="width: 150px">
                <el-option label="男" value="男" @keyup="handleQuery"></el-option>
                <el-option label="女" value="女" @keyup="handleQuery"></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="4.5">
            <el-form-item label="年龄" prop="age">

              <el-input-number v-model="form.age" controls-position="right" size="small" :min="0" :max="100"
                               style="width: 150px"/>
            </el-form-item>
          </el-col>
          <el-col :span="4.5">
            <el-form-item label="学历" prop="education">
              <el-select v-model="form.education" name="本科" placeholder="请选择学历" style="width: 150px">
                <el-option label="请选择" value="" @keyup="handleQuery"></el-option>
                <el-option label="专科" value="专科" @keyup="handleQuery"></el-option>
                <el-option label="本科" value="本科" @keyup="handleQuery"></el-option>
                <el-option label="硕士" value="硕士" @keyup="handleQuery"></el-option>
                <el-option label="博士" value="博士" @keyup="handleQuery"></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="4.5">
            <el-form-item label="电话" prop="phone">
              <el-input v-model="form.phone" placeholder="请输入电话" style="width: 150px"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="4.5">
            <el-form-item label="邮箱" prop="mailbox">
              <el-input v-model="form.mailbox" placeholder="请输入邮箱" style="width: 150px"/>
            </el-form-item>
          </el-col>
          <el-col :span="4.5">
            <el-form-item label="适合岗位" prop="expectStation">
              <el-input v-model="form.expectStation" placeholder="请选择岗位" style="width: 150px"/>
            </el-form-item>
          </el-col>

          <el-col :span="4.5">
            <el-form-item label="期望薪资" prop="expectWage">
              <el-input-number v-model="form.expectWage" controls-position="right" size="small" :min="0" :max="100"
                               style="width: 150px"/>
            </el-form-item>
          </el-col>

          <el-col :span="4.5">
            <el-form-item label="工作经验" prop="workyear">
              <el-input v-model="form.workyear" placeholder="请填写工作经验" style="width: 150px"/>
            </el-form-item>
          </el-col>

          <el-col :span="4.5">
            <el-form-item label="工作地点" prop="workplace">
              <el-input v-model="form.workplace" placeholder="请输入工作地点" style="width: 150px"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="4.5">
            <el-form-item label="毕业学校" prop="college">
              <el-input v-model="form.college" placeholder="请输入毕业学校" style="width: 150px"/>
            </el-form-item>
          </el-col>
          <el-col :span="4.5">
            <el-form-item label="所学专业" prop="major">
              <el-input v-model="form.major" placeholder="请输入所学专业" style="width: 150px"/>
            </el-form-item>
          </el-col>

          <el-col :span="4.5">
            <el-form-item label="目前状态" prop="currentState">
              <el-select v-model="form.currentState" placeholder="请选择">
                <el-option value="在职">在职</el-option>
                <el-option value="离职">已离职</el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4.5">
            <el-form-item label="初审意见" prop="opinion">
              <el-input
                type="textarea"
                :rows="2"
                placeholder="请输入内容"
                v-model="form.opinion">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="专业技能" prop="professionalSkill">
          <editor v-model="form.professionalSkill" :min-height="192" style="white-space:pre-wrap"/>
        </el-form-item>

        <el-form-item label="工作经历" prop="workeUndergo">
          <editor v-model="form.workeUndergo" :min-height="192" style="white-space:pre-wrap"/>
        </el-form-item>

        <el-form-item label="项目经验" prop="projectUndergo">
          <editor v-model="form.projectUndergo" :min-height="192" style="white-space:pre-wrap"/>
        </el-form-item>

        <el-form-item label="教育背景" prop="educationalBackground">
          <editor v-model="form.educationalBackground" :min-height="192" style="white-space:pre-wrap"/>
        </el-form-item>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" v-on='{click:submitForm}'> 确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 岗位推送对话框 -->
    <el-dialog :title="title" :visible.sync="videoVisible" width="90%" :close-on-click-modal='false' append-to-body>

      <el-form :model="stationList" ref="queryForm" size="small" :inline="true" v-show="showSearch"
               label-width="68px">
        <el-form-item label="" prop="beginTime">
          <el-date-picker clearable
                          v-model="queryStationParams.beginTime"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="开始日期">
          </el-date-picker>
        </el-form-item>

        <el-form-item prop="endTimee">
          <el-date-picker clearable
                          v-model="queryStationParams.endTimee"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="结束日期">
          </el-date-picker>
        </el-form-item>

        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
        <el-form-item prop="companyName">
          <el-input
            v-model="queryStationParams.all"
            placeholder="请输入搜索内容"
            clearable
            @keyup.enter.native="handleQueryStation"
          />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="max" @click="handleQueryStation">搜索</el-button>
          <el-button icon="el-icon-refresh" size="max" @click="resetQueryStation">重置</el-button>
        </el-form-item>
      </el-form>

      <!--      岗位列表推送-->
      <el-table v-loading="loading" :data="stationList" style="width: 100%" max-height="100%">
        <el-table-column type="selection" align="center" width="50"/>
        <el-table-column :show-overflow-tooltip="true" label="岗位名称" align="center" prop="stationName" width="120"/>
        <el-table-column label="岗位等级" align="center" prop="jobGrade" width="110"/>
        <el-table-column label="岗位类型" align="center" prop="stationCategory" width="105"/>
       <!-- <el-table-column :show-overflow-tooltip="true" label="企业名称" align="center" prop="companyName" width="200"/>
        <el-table-column :show-overflow-tooltip="true" label="项目组" align="center" prop="proName" width="120"/>-->
        <el-table-column label="待初筛" align="center" width="70" prop="cou0">
          <template slot-scope="scope">
          <span v-if="scope.row.cou0 == null">
           0
          </span>
            <span v-if="scope.row.cou0 != null">
           {{ scope.row.cou0 }}
          </span>
          </template>


        </el-table-column>
        <el-table-column label="待面试" align="center" width="70" prop="cou1">
          <template slot-scope="scope">
          <span v-if="scope.row.cou1 == null">
           0
          </span>
            <span v-if="scope.row.cou1 != null">
           {{ scope.row.cou1 }}
          </span>
          </template>

        </el-table-column>
        <el-table-column label="待入职" align="center" width="70" prop="cou2">
          <template slot-scope="scope">
          <span v-if="scope.row.cou2 == null">
           0
          </span>
            <span v-if="scope.row.cou2 != null">
           {{ scope.row.cou2 }}
          </span>
          </template>
        </el-table-column>
        <el-table-column label="待录用" align="center" width="70" prop="cou2">
          <template slot-scope="scope">
          <span v-if="scope.row.cou3 == null">
           0
          </span>
            <span v-if="scope.row.cou3 != null">
           {{ scope.row.cou3 }}
          </span>
          </template>
        </el-table-column>
        <el-table-column label="已入职" align="center" width="70" prop="cou3">
          <template slot-scope="scope">
          <span v-if="scope.row.cou6 == null">
           0
          </span>
            <span v-if="scope.row.cou6 != null">
           {{ scope.row.cou6 }}
          </span>
          </template>
        </el-table-column>
        <el-table-column label="薪资范围" align="center" prop="startMoney" width="120">
          <template slot-scope="scope">
            {{ scope.row.startMoney + '~' + scope.row.endMoney }} K
          </template>
        </el-table-column>

        <el-table-column label="岗位定价(K)" align="center" prop="postPricing" width="110">
          <template slot-scope="scope">
            <span v-if="scope.row.postPricing == null">无</span>
            <span v-if="scope.row.postPricing != null">{{ scope.row.postPricing + 'K' }}</span>
          </template>


        </el-table-column>
        <el-table-column label="负责商务" align="center" prop="createdBy" width="130"/>
        <el-table-column label="招聘人数" align="center" prop="need" width="110"/>
        <el-table-column label="招聘截止" align="center" prop="wokeEndTime" width="130">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.wokeEndTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>

        <el-table-column label="岗位创建时间" align="center" prop="createTime" width="150">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" width="200" align="center" class-name="small-padding fixed-width" fixed="right">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-share"
              @click="playVideStation(scope.row.stationId)"
              v-hasPermi="['system:station:query']"
            >详情
            </el-button>
            <el-button
              size="mini"
              type="text"
              icon="el-icon-s-promotion"
              @click="addAuits(scope.row.stationId,scope.row.imgPath)"
              v-hasPermi="['system:auitvo:add']"
            >推送
            </el-button>
          </template>
        </el-table-column>
      </el-table>

      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryStationParams.pageNum"
        :limit.sync="queryStationParams.pageSize"
        @pagination="getStationList"
      />
    </el-dialog>

    <!-- 岗位详情对话框 -->
    <el-dialog :title="title" :visible.sync="videoStation" width="90%" :close-on-click-modal='false' append-to-body
               border>
      <el-descriptions class="margin-top" :column="4" size="medium" border>


        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              岗位名称
            </center>
          </template>
          <center>
            {{ ItoStation.stationName }}
          </center>
        </el-descriptions-item>

       <!-- <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              企业名称
            </center>
          </template>
          <center>
            {{ ItoStation.companyName }}
          </center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              项目组
            </center>
          </template>
          <center>
            {{ ItoStation.proName }}
          </center>
        </el-descriptions-item>-->
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              岗位类别
            </center>
          </template>
          <center>
            {{ ItoStation.stationCategory }}
          </center>
        </el-descriptions-item>

        <el-descriptions-item v-if=" ItoStation.postPricing == null">
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              RPO岗位定价(K)
            </center>
          </template>
          <center>
            无
          </center>
        </el-descriptions-item>
        <el-descriptions-item v-if="ItoStation.postPricing != null">
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              RPO岗位定价(K)
            </center>
          </template>
          <center>
            {{ ItoStation.postPricing + 'K' }}
          </center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              负责商务
            </center>
          </template>
          <center>{{ ItoStation.createdBy }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              发布日期
            </center>
          </template>
          <center>{{ parseTime(ItoStation.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              学历要求
            </center>
          </template>
          <center>{{ ItoStation.education }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              岗位等级
            </center>
          </template>
          <center>
            {{ ItoStation.jobGrade }}
          </center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              用工时长
            </center>
          </template>
          <center>{{ ItoStation.endTime }}</center>
        </el-descriptions-item>

        <!--        <span v-if="interview==true">-->
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              工资薪酬(K)
            </center>
          </template>
          <center v-if="ItoStation.interview == 0 ">{{ ItoStation.startMoney }}—{{ ItoStation.endMoney }}K</center>
          <center v-if="ItoStation.interview == 1 ">面议</center>

        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              招聘人数
            </center>
          </template>
          <center>{{ ItoStation.need }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              招聘截止日期
            </center>
          </template>
          <center>{{ parseTime(ItoStation.wokeEndTime, '{y}-{m}-{d}') }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              省市区
            </center>
          </template>
          <center>
            {{ ItoStation.province }}
          </center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              详细地址
            </center>
          </template>
          <center>
            {{ ItoStation.wokeAddress }}
          </center>
        </el-descriptions-item>


      </el-descriptions>
      <el-descriptions class="margin-top" size="medium" direction="vertical" :column="2" border>

        <el-descriptions-item :span="4">
          <template slot="label">
            <i class="el-icon-user"></i>
            岗位职责
          </template>
          <span v-html="ItoStation.jobDescription"></span>
        </el-descriptions-item>


        <el-descriptions-item :span="4">
          <template slot="label">
            <i class="el-icon-user"></i>
            岗位要求
          </template>
          <span v-html="ItoStation.remarks"></span>
        </el-descriptions-item>
      </el-descriptions>

    </el-dialog>

    <!-- 简历详情对话框 -->
    <el-dialog :title="title" :visible.sync="videoVisibles" width="90%" :close-on-click-modal='false' append-to-body
               border>
      <el-button
        size="mini"
        type="text"
        v-if="itoResume.status !== '11'"
        icon="el-icon-s-promotion"
        @click="playVideo(itoResume.resumeId,itoResume.imgPath)"
      >投递岗位
      </el-button>
      <el-button
        size="mini"
        type="text"
        icon="el-icon-edit"
        @click="handleUpdate2(itoResume)"
        v-hasPermi="['system:resume:edit']"
      >编辑
      </el-button>
      <el-button
        size="mini"
        type="text"
        icon="el-icon-s-promotion"
        @click="download1(itoResume.resumeId,itoResume.imgPath)"
      >简历下载
      </el-button>
      <!--      <el-button
              type="text"
              size="mini"
              icon="el-icon-s-promotion"
              @click="dialogVisible0 = true"
            >查看原始简历
            </el-button>-->
      &nbsp;&nbsp;&nbsp;&nbsp;
      <a :href="pathUrl" target="_blank" style='color: #00afff'>查看原始简历</a>
      &nbsp;&nbsp;&nbsp;&nbsp;
      <el-table-column label="状态" align="center" prop="status">
        <template>
          <span v-if="itoResume.status == 0">
            <el-tag type="info">未投递</el-tag>
          </span>
          <span v-if="itoResume.status == 1">
             <el-tag type="primary">已投递</el-tag>
          </span>
          <span v-if="itoResume.status == 2">
             <el-tag type="warning">待入职</el-tag>
          </span>
          <span v-if="itoResume.status == 3">
             <el-tag type="success">已入职</el-tag>
          </span>
          <span v-if="itoResume.status == 4">
             <el-tag type="danger">已离职</el-tag>
          </span>
          <span v-if="itoResume.status == 11">
             <el-tag type="warning">放弃入职</el-tag>
          </span>
        </template>
      </el-table-column>

      <el-descriptions class="margin-top" :column="5" size="medium" border>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              简历名称
            </center>

          </template>
          <center>
            {{ itoResume.resumeName }}
          </center>

        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              性别
            </center>
          </template>
          <center>
            {{ itoResume.sex }}
          </center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              年龄
            </center>
          </template>
          <center>
            {{ itoResume.age }}
          </center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              学历
            </center>
          </template>
          <center>
            {{ itoResume.education }}
          </center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              电话
            </center>
          </template>
          <center>
            {{ itoResume.phone }}
          </center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              工作经验(年限)
            </center>
          </template>
          <center>{{ itoResume.workyear }}</center>

        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              邮箱
            </center>

          </template>
          <center>{{ itoResume.mailbox }}</center>

        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              期望岗位
            </center>

          </template>
          <center>{{ itoResume.expectStation }}</center>

        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              期望薪资(K)
            </center>

          </template>
          <center>{{ itoResume.expectWage }}</center>

        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              工作地点
            </center>

          </template>
          <center>{{ itoResume.workplace }}</center>

        </el-descriptions-item>
        <el-descriptions-item :span="1">
          <template slot="label">
            <center><i class="el-icon-user"></i>
              创建时间
            </center>

          </template>
          <center>{{ parseTime(itoResume.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</center>
        </el-descriptions-item>
        <el-descriptions-item :span="1">
          <template slot="label">
            <center><i class="el-icon-user"></i>
              毕业院校
            </center>

          </template>
          <center>{{ itoResume.college }}</center>
        </el-descriptions-item>
        <el-descriptions-item :span="1">
          <template slot="label">
            <center><i class="el-icon-user"></i>
              所学专业
            </center>

          </template>
          <center>{{ itoResume.major }}</center>
        </el-descriptions-item>
        <el-descriptions-item :span="1">
          <template slot="label">
            <center><i class="el-icon-user"></i>
              在职状态
            </center>

          </template>
          <center>{{ itoResume.currentState }}</center>
        </el-descriptions-item>
        <el-descriptions-item :span="1">
          <template slot="label">
            <center><i class="el-icon-user"></i>
              初审意见
            </center>

          </template>
          <center>{{ itoResume.opinion }}</center>
        </el-descriptions-item>
      </el-descriptions>
      <el-descriptions class="margin-top" size="medium" direction="vertical" :column="4" border>

        <el-descriptions-item :span="4">
          <template slot="label">
            <i class="el-icon-user"></i>
            专业技能
          </template>
          <span v-html="itoResume.professionalSkill"></span>
        </el-descriptions-item>

        <el-descriptions-item :span="4">
          <template slot="label">
            <i class="el-icon-user"></i>
            工作经历
          </template>
          <span v-html="itoResume.workeUndergo"></span>
        </el-descriptions-item>
        <el-descriptions-item :span="4">
          <template slot="label">
            <i class="el-icon-user"></i>
            项目经验
          </template>
          <span v-html="itoResume.projectUndergo"></span>
        </el-descriptions-item>
        <el-descriptions-item :span="4">
          <template slot="label">
            <i class="el-icon-user"></i>
            教育背景
          </template>
          <span v-html="itoResume.educationalBackground"></span>
        </el-descriptions-item>
      </el-descriptions>
    </el-dialog>
  </div>
</template>

<script>
  // 引用组件
  import {
    listResume,
    getResume,
    delResume,
    addResume,
    updateResume,
    addAuit,
    uploadFile,
    uploadFile2,
    handleAnlysis, handleAnlysis1,
    getResumeName,
    getAudit
  } from "@/api/system/resume";
  import {getStation} from "@/api/system/station";
  // pdf预览
  import pdf from 'vue-pdf'
  import Link from "@/layout/components/Sidebar/Link";
  import {listStation} from '@/api/system/delivery'

  export default {

    components: {
      Link,
      pdf
    },
    name: "Resume",
    data() {
      return {
        localh: "localhost/",

        btnText: '查看原始简历',
        currentPage: 0, // pdf文件页码
        pageCount: 0, // pdf文件总页数
        /*scale: 100,
        pageRotate: 0,*/
        isExit: false,
        dialogVisible0: false,
        dialogVisible4: false,
        pathUrl: '', // 将从后台获取到的 PDF 文件地址赋值给这个字段
        loading2: false,
        filePath: null,
        filename: '',
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 简历表格数据
        resumeList: [],
        // 岗位表格数据
        stationList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        videoVisible: false,
        videoStation: false,
        // 是否显示弹出层
        opens: false,
        videoVisibles: false,
        // 查询参数
        itoResume: {
          resumeId: null,
          resumeName: null,
          sex: null,
          age: null,
          imgPath: null,
          filePath: null,
          education: null,
          phone: null,
          workyear: null,
          mailbox: null,
          expectStation: null,
          expectWage: null,
          workplace: null,
          professionalSkill: null,
          workeUndergo: null,
          projectUndergo: null,
          educationalBackground: null,
          selfEvaluate: null,
          status: null,
          isDelete: 0,

        },
        // 岗位详情
        ItoStation: {
          stationId: null,
          stationName: null,
          stationCategory: null,
          postPricing: null,
          jobGrade: null,
          experience: null,
          jobDescription: null,
          education: null,
          recruited: null,
          need: null,
          companyName: null,
          province: null,
          wokeAddress: null,
          companyPhone: null,
          companyMailbox: null,
          endTime: null,
          salaryRange: null,
          remarks: null,
          companyWelfare: null,
          createTime: null,
          createdBy: null,
          updateTime: null,
          updatedBy: null,
          wokeEndTime: null,
          startMoney: null,
          endMoney: null,
          status: null,
          interview: null,
          isDelete: null
        },
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          resumeId: null,
          resumeName: null,
          sex: null,
          age: null,
          imgPath: null,
          filePath: null,
          education: null,
          phone: null,
          workyear: null,
          mailbox: null,
          expectStation: null,
          expectWage: null,
          workplace: null,
          professionalSkill: null,
          workeUndergo: null,
          projectUndergo: null,
          educationalBackground: null,
          selfEvaluate: null,
          status: null,
          isDelete: 0,

          lowAge: undefined,
          tallAge: undefined,
          lowWage: undefined,
          tallWage: undefined,
          lowWorkyear: undefined,
          tallWorkyear: undefined,
          all: null,
          beginTime: null,
          endTimee: null,
        },
        // 岗位查询参数
        queryStationParams: {
          pageNum: 1,
          pageSize: 10,
          stationName: null,
          stationCategory: null,
          jobGrade: null,
          experience: null,
          jobDescription: null,
          education: null,
          recruited: null,
          need: null,
          companyName: null,
          wokeAddress: null,
          companyPhone: null,
          companyMailbox: null,
          endTime: null,
          salaryRange: null,
          remarks: null,
          companyWelfare: null,
          createTime: null,
          createdBy: null,
          updateTime: null,
          updatedBy: null,
          wokeEndTime: null,
          startMoney: undefined,
          endMoney: undefined,
          beginTime: null,
          endTimee: null,
          status: null,
          cou0: null,
          cou1: null,
          cou2: null,
          cou3: null,
          all: null,
          isDelete: '0'
        },
        //简历推送添加
        addAuit: {
          resumeIds: {},
          tationId: {}
        },
        // 简历表单参数
        form: {
          resumeId: null,
          resumeName: null,
          sex: null,
          age: undefined,
          imgPath: null,
          filePath: null,
          education: null,
          phone: null,
          workyear: undefined,
          mailbox: null,
          expectStation: null,
          expectWage: null,
          workplace: null,
          professionalSkill: null,
          workeUndergo: null,
          projectUndergo: null,
          educationalBackground: null,
          selfEvaluate: null,
          status: null,
          isDelete: 0,
          lowAge: undefined,
          tallAge: undefined,
          lowWage: undefined,
          tallWage: undefined,
          lowWorkyear: undefined,
          tallWorkyear: undefined,
          major: undefined,
          currentState: undefined,
          opinion: undefined
        },// 表单参数
        // 表单校验
        rules: {
          filePath: [
            {required: true, message: '简历附件未上传', trigger: 'blur'}
          ],
          resumeName: [
            {required: true, message: '姓名不能为空', trigger: 'blur'}
          ],
          sex: [
            {required: true, message: '性别不能为空', trigger: 'blur'}
          ], age: [
            {required: true, message: '年龄不能为空', trigger: 'blur'},
            {pattern: /^([1-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/, message: '年龄不能为0', trigger: 'blur'},
          ],
          expectWage: [
            {required: true, message: '期望薪资不能为空', trigger: 'blur'},
          ],
          imgPath: [
            {required: true, message: '文件路径不能为空', trigger: 'blur'}
          ],
          education: [
            {required: true, message: '学历不能为空', trigger: 'blur'}
          ],
          phone: [
            {required: true, message: '电话不能为空', trigger: 'blur'},
            {pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur"}
          ],
          workyear: [
            {required: true, message: '工作经验不能为空', trigger: 'blur'},
          ],
          mailbox: [
            {required: true, message: '邮箱不能为空', trigger: 'blur'},
            {type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change']}
          ],
          workeUndergo: [
            {required: true, message: '工作经历不能为空', trigger: 'blur'}
          ],
          projectUndergo: [
            {required: true, message: '项目经验不能为空', trigger: 'blur'}
          ],
          educationalBackground: [
            {required: true, message: '教育背景不能为空', trigger: 'blur'}
          ],
          selfEvaluate: [
            {required: true, message: '自我评价不能为空', trigger: 'blur'}
          ],
          workplace: [
            {required: true, message: '工作地点不能为空', trigger: 'blur'}
          ],
          expectStation: [
            {required: true, message: '适合岗位', trigger: 'blur'}
          ],
          college:[
            {required: true, message: '毕业学校不能为空', trigger: 'blur'}
          ],
          major: [
            {required: true, message: '所学专业不能为空', trigger: 'blur'}
          ],
          currentState: [
            {required: true, message: '请选择在职状态', trigger: 'change'}
          ],
          opinion: [
            {required: true, message: '请填写初审意见', trigger: 'blur'}
          ]
        },
        newPath: null,
        filePaths: [],
        resumeIds: {},
        formQuery: {}
      };
    },
    created() {
      this.getList();
    }
    ,
    methods: {

      /** 查询岗位列表 */
      getStationList() {
        this.loading = true;
        listStation(this.queryStationParams).then(response => {
          console.log(response)
          this.stationList = response.rows;
          this.total = response.total;
        });
        this.loading = false;
      }
      ,
      /** 查询【请填写功能名称】列表 */
      getList() {
        this.loading = true;
        listResume(this.queryParams).then(response => {
          this.resumeList = response.rows;
          this.total = response.total;
          this.loading = false;
        }).catch(e=>{
          this.loading = false;
        });
      }
      ,
      // 取消按钮
      cancel() {
        this.open = false;
        this.filePath = null;
        this.reset();
      }
      ,
      // 取消按钮
      cancela() {
        this.open = false;
        this.reseta();
      }
      ,
      // 表单重置
      reset() {

        this.form = {
          resumeId: null,
          resumeName: null,
          sex: null,
          age: undefined,
          imgPath: null,
          filePath: null,
          education: null,
          phone: null,
          workyear: undefined,
          mailbox: null,
          expectStation: null,
          expectWage: undefined,
          workplace: null,
          professionalSkill: null,
          workeUndergo: null,
          projectUndergo: null,
          educationalBackground: null,
          selfEvaluate: null,
          createTime: null,
          createBy: null,
          updateTime: null,
          updateBy: null,
          status: "0",
          isDelete: "0",
          lowAge: undefined,
          tallAge: undefined,
          lowWage: undefined,
          tallWage: undefined,
          lowWorkyear: undefined,
          tallWorkyear: undefined,
          major: undefined,
          currentState: undefined,
          opinion: undefined
        };
        this.resetForm("form");
      }
      ,
      // 表单重置
      reseta() {
        this.form = {};
        this.resetForm("form");
      }
      ,

      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      }
      ,
      /** 搜索按钮操作 */
      handleQueryStation() {
        this.queryStationParams.pageNum = 1;
        this.getStationList();
      }
      ,

      /** 重置按钮操作 */
      resetQuery() {
        this.queryParams = {
          isDelete: "0"
        };
        this.resetForm("queryForm");
        this.handleQuery();
      }
      ,
      /** 重置按钮操作 */
      resetQueryStation() {
        this.queryStationParams = {};
        this.resetForm("queryForm");
        this.handleQueryStation();
      }
      ,
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.resumeId)
        this.single = selection.length !== 1
        this.multiple = !selection.length
        selection.map(it => {
          this.multiple = it.status === '3' || it.status === '6' ? true : false
        })
      }
      ,
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.open = true;
        this.title = "添加";
      }
      ,


      /*简历推送添加*/
      addAuits(stationId) {
        getAudit(this.ids,stationId).then(res =>{
          console.log(res)
          if (res.data.length > 0){
            this.$message({
              message: '已投递该岗位',
              type: 'warning'
            });
          }else {
            addAuit(this.ids, stationId).then(response => {
              this.$modal.msgSuccess("推送成功");
              this.open = false;
              this.getList()
              this.videoVisible = false
            });
          }
        })
      }
      ,
      /*文件下载*/
      download1(resumeId) {
        this.$download.zip(resumeId)
      }

      , handleAnlysis1(resumeId) {
        this.$download.resource(resumeId)
      },

      /*文件上传*/
      handleChange(file) {
        if (file != null) {
          let formData = new FormData();
          formData.append('file', file.raw)
          const loading = this.$loading({
            lock: true,
            text: 'Loading',
            spinner: 'el-icon-loading',
            background: 'rgba(0, 0, 0, 0.7)'
          });
          uploadFile2(formData).then(response => {
            this.filePath = response;
            uploadFile(formData).then(response => {
              console.log(response);
              this.form = response;
              this.form.filePath = this.filePath;
              loading.close();
              this.msgSuccess("上传成功！");
            });
          });

        }
      }
      , /*/!*文件解析解析*!/
    handleAnlysis(file) {
      if (file != null) {
        let formData = new FormData();
        formData.append('file', file.raw)
        uploadFile(formData).then(response => {
          this.form = response;
          this.form.filePath = this.filePath;
          this.msgSuccess("上传成功！");
        });
      }
    }
    ,*/
      /** 修改按钮操作 */
      handleUpdate(row) {
        this.reset();
        const resumeId = row.resumeId || this.ids
        getResume(resumeId).then(response => {
          this.form = response.data;
          this.open = true;
          this.title = "修改";
        });
      }
      ,
      /** 修改按钮操作 */
      handleUpdate2(itoResume) {
        this.reset();
        const resumeId = itoResume.resumeId || this.ids
        getResume(resumeId).then(response => {
          this.form = response.data;
          this.open = true;
          this.title = "编辑";
        });
      }
      ,
      /** 提交按钮 */
      submitForm() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            const loading = this.$loading({
              lock: true,
              text: 'Loading',
              spinner: 'el-icon-loading',
              background: 'rgba(0, 0, 0, 0.7)'
            });
            if (this.form.resumeId != null) {
              this.formQuery = this.form
              this.formQuery.professionalSkill = encodeURIComponent(this.formQuery.professionalSkill);
              this.formQuery.educationalBackground = encodeURIComponent(this.formQuery.educationalBackground);
              this.formQuery.projectUndergo = encodeURIComponent(this.formQuery.projectUndergo);
              this.formQuery.workeUndergo = encodeURIComponent(this.formQuery.workeUndergo);
              this.formQuery.filePath = this.filePath
              updateResume(this.formQuery).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                loading.close();
                this.filePath = null;
                this.getResume(this.form.resumeId);
                this.formQuery = {}
                this.getList();
              }).catch(res => {
                loading.close();
              });
            } else {
              this.formQuery.filePath = this.filePath
              getResumeName(this.form).then(res => {
                if (res.data.length > 0) {
                  this.$message({
                    message: '简历（姓名，手机号）已存在',
                    type: 'warning'
                  });
                  loading.close();
                } else {
                  this.formQuery = this.form
                  this.formQuery.professionalSkill = encodeURIComponent(this.formQuery.professionalSkill);
                  this.formQuery.educationalBackground = encodeURIComponent(this.formQuery.educationalBackground);
                  this.formQuery.projectUndergo = encodeURIComponent(this.formQuery.projectUndergo);
                  this.formQuery.workeUndergo = encodeURIComponent(this.formQuery.workeUndergo);
                  addResume(this.formQuery).then(response => {
                    this.open = false;
                    this.$modal.msgSuccess("新增成功");
                    this.filePath = null;
                    this.formQuery = {}
                    this.form = {}
                    this.getList();
                    loading.close();
                  });

                }
              }).catch(res => {
                loading.close();
              })
            }
          }
        });
      }
      ,

      /** 删除按钮操作 */
      handleDelete(row) {
        const resumeId = row.resumeId || this.ids;
        this.$modal.confirm('是否确认删除这条的数据项？').then(function () {
          return delResume(resumeId);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(() => {
        });
      }
      ,

      /** 简历列表后的投递岗位按钮操作 */
//点击按钮时,触发弹出效果
      playVideo(resumeId, imgPath) {
        this.ids = resumeId
        /*点击推送弹出岗位列表时,将简历的文件路径拿了出来*/
        this.filePaths = imgPath
        //触发点击时,让其显示
        this.videoVisible = true
        this.title = "岗位列表"
        this.getStationList()
      }
      ,
      /** 推送按钮操作 */
//点击按钮时,触发弹出效果
      playVideoA() {
        //触发点击时,让其显示
        this.videoVisible = true
        this.getStationList()
      }
      ,

      /** 详情按钮操作 */
      //点击按钮时,触发弹出效果
      getResume(resumeId) {
        getResume(resumeId).then(response => {
          this.itoResume = response.data;
          this.pathUrl = '/prod-api/' + this.itoResume.filePath;
          //触发点击时,让其显示
          this.videoVisibles = true
          this.title = "简历详情";
        });
      }
      ,
//事件操作 (表格、表单 同理 需要执行的事件 在此处)
      closeDialog() {
        //点击展示岗位列表
        this.getStationList();
        this.getList();
      }
      ,

      /** 详情按钮操作 */
//点击按钮时,触发弹出效果
      playVideStation(stationId) {
        getStation(stationId).then(response => {
          this.ItoStation = response.data;
          this.videoStation = true
          this.title = "岗位详情";
        });
      }
      , /** 导出按钮操作 */
      handleExport() {
        this.download('/system/resume/export/0', {
          ...this.queryParams
        }, `resume_${new Date().getTime()}.xlsx`)
      },

    }
  }

</script>
<style scoped>

  .btn {
    margin: 20px 0px;
  }

  .main {
    border: 2px solid #dcdfe6;
    height: 600px;
    overflow: auto;
  }

  .tools {
    display: flex;
  }

  .total {
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main::-webkit-scrollbar {
    width: 6px;
  }

  /* 修改 滚动条的 下面 的 样式 */
  .main::-webkit-scrollbar-track {
    background-color: white;
    -webkit-border-radius: 2em;
    -moz-border-radius: 2em;
    border-radius: 2em;
  }

  /* 修改 滑块 */
  .main::-webkit-scrollbar-thumb {
    background-color: #dcdfe6;
    -webkit-border-radius: 2em;
    -moz-border-radius: 2em;
    border-radius: 2em;
  }

  /*弹窗高度加内容字体*/
  /*/deep/ .el-dialog {
    height: 735px;
  !*  font-family: '楷体';*!
  }*/

  /deep/ .el-dialog__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #673ab7;
  }

  /deep/ .el-dialog__title,
  /deep/ .el-dialog__headerbtn .el-dialog__close {
    color: white;
  }

  /deep/ .el-dialog__body {
    padding: 20px;
  }

  /deep/ .el-select {
    width: 95px;
    height: 28px;
    margin: 5px 20px 0px 20px;
  }
</style>
